#include "SaRnHtml.h" void SaPopulateOptions(Widget list, XtPointer client_data, SaCallbackStruct *cbs);
<SELECT NAME="Authors"> <OPTION>##Sa_authors##</OPTION> </SELECT>This call assumes that the select and at least one option item has been declared in the HTML template. This will produce one list item for each row in
cbs
. If more than one column is bound to the site, then each row will consist of columns concatenated. The columns are aligned by padding in spaces. They will only look aligned to the user if the list item is within <PRE> </PRE> tags. Also, the value retrieved and the value seen by the user are the same. If you want these to be different, then a Sapphire/Web Loop construct would be needed. The HTML fragment is:
<SELECT NAME="Authors"> ##Sa_BeginLoop## <OPTION VALUE="##Sa_authorID##"</OPTION>##Sa_Authors## ##Sa_EndLoop## </SELECT>
/*** the following ad-hoc example can be used without templates **/ SaCallbackStruct *cbs; cbs = SaExecSQL("CEZANNE", "pubs2", SGESYBASE, "select * from authors"); /***** print html, select, and option item headers *****/ SaPopulateOptions(NULL, NULL, cbs); /*** print out end of select, option item and html headers ***/ SaFreeCbs(cbs);